import javax.swing.*;
import java.awt.*;
import java.awt.image.*;

public class DefaultPen extends Pen {

  String name = "DefaultPen";
  int prevX;
  int prevY;
  Graphics2D currentGraphics;
 

  public DefaultPen() {
    this.inputPanel = new JPanel();
    this.inputPanel.setBackground(Color.black);
  }

  public String getName(){
    return this.name;
  }
  public void drawPreview(){
    return;
  }

  public void select(){
    return;
  }
  
  public void penUp(int x, int y){
    currentGraphics.drawLine(x,y, prevX, prevY);
  }
  
  public void penDown(int x, int y){
    this.currentGraphics = this.kanvasImage.createGraphics();
    this.currentGraphics.setColor(Color.black);
    prevX = x;
    prevY = y;
  }
  
  public void penDrag(int x, int y){ // store old values in Pen class, update and draw line between.
    currentGraphics.drawLine(x,y, prevX, prevY);
    prevX = x;
    prevY = y;
  }
}
